package com.youlu.campus.activity.repositories;

import com.youlu.campus.activity.entity.UserLotteryRecord;
import org.springframework.data.mongodb.repository.MongoRepository;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 用户抽奖记录
 *
 * @Description: UserLotteryRecordRepository
 * @Date 2025/7/31
 * @author: su
 */
public interface UserLotteryRecordRepository extends MongoRepository<UserLotteryRecord, String> {

    List<UserLotteryRecord> findByRecordType(String recordType);

    void deleteByActivityIdAndRecordType(@NotNull(message = "活动ID不能为空") String activityId, String recordType);

    /**
     * 根据 记录类型 与活动id 查询
     *
     * @param recordType
     * @param activityId
     * @return
     */
    List<UserLotteryRecord> findByRecordTypeAndActivityId(String recordType, @NotNull(message = "活动ID不能为空") String activityId);
}
